/*
 * @Description: 
 * @version: 
 * @Author: yyconion
 * @Date: 2021-06-20 16:23:55
 * @LastEditors: yyconion
 * @LastEditTime: 2021-11-16 14:09:49
 */
import {
  createApp
} from 'vue'
// 导入router和store
import App from './App.vue'
import router from './router'
import store from './store'


// 引入echarts和highcharts插件
import ElementPlus from '@/plugins/elementplus'
import Highcharts from '@/plugins/highcharts'
import axios from '@/request'
import Echarts from '@/plugins/echarts'
import Cookies from '@/plugins/jsCookies'


// rem布局，最大字体大小40px，最小12px，比例  1rem=20px
var reacttive = (userWidth) => {
  let htmlWidth = document.documentElement.clientWidth;
  let fontSize = (20 * (htmlWidth / userWidth) > 40 ? 40 : (20 * (htmlWidth / userWidth)))
  if (fontSize < 12) fontSize = 12
  document.documentElement.style.fontSize = fontSize + 'px'
}
window.addEventListener('resize', () => reacttive(1903))
window.addEventListener('load', () => reacttive(1903))


// 实例化项目
const app = createApp(App).use(router).use(ElementPlus)
window.store = store
// 添加全局属性
app.config.globalProperties.$store = store
app.config.globalProperties.$echarts = Echarts
app.config.globalProperties.$highecharts = Highcharts
app.config.globalProperties.$http = axios
app.config.globalProperties.$cookie = Cookies
// 挂载vue实例到dom节点
app.mount('#app')